package org.lds.message.center.server.endpoint;

import lombok.RequiredArgsConstructor;
import org.lds.message.center.common.Endpoint;
import org.lds.message.center.common.constant.EndpointConstant;
import org.lds.message.center.common.model.ResultDTO;
import org.lds.message.center.common.model.request.PublicRequest;
import org.lds.message.center.core.DefaultEndpoint;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(EndpointConstant.V1)
@RequiredArgsConstructor
public class HttpEndpoint implements Endpoint {

    private final DefaultEndpoint defaultEndpoint;

    /**
     * 通用接口
     *
     * @param request
     */
    @Override
    @PostMapping(EndpointConstant.PUBLIC)
    public ResultDTO common(@RequestBody PublicRequest request) {
        return defaultEndpoint.common(request);
    }

}
